package PTA3.ti7;

/**
 * @author Lenovo
 */
public class Main {
    private String name;
    private int age;

    // 有参构造方法
    public Main(String name, int age) {
        this.name = name;
        this.age = age;
    }

    // 获取姓名
    public String getName() {
        return name;
    }

    // 获取年龄
    public int getAge() {
        return age;
    }

    public static void main(String[] args) {
        // 创建两个Person对象
        Main person1 = new Main("lili", 19);
        Main person2 = new Main("lucy", 20);

        // 输出对象信息
        System.out.println("this person is " + person1.getName() + ",her age is " + person1.getAge());
        System.out.println("this person is " + person2.getName() + ",her age is " + person2.getAge());
    }
}
